package com.gu.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.gu.entity.UserDO;
import java.util.List;
import com.gu.mapper.UserMapper;

/**
* The Table gu_user.
* 系统用户表
*/
@Repository
public class UserDAO{

    @Autowired
    private UserMapper userMapper;

    /**
     * desc:插入表:gu_user.<br/>
     * @param entity entity
     * @return Integer
     */
    public Integer insert(UserDO entity){
        return userMapper.insert(entity);
    }
    /**
     * desc:根据主键获取数据:gu_user.<br/>
     * @param id id
     * @return UserDO
     */
    public UserDO getById(Integer id){
        return userMapper.getById(id);
    }

    public UserDO selectUserByUserPhone(String userPhone) {
        return userMapper.selectUserByUserPhone(userPhone);
    }

    public Integer deleteUserById(Integer id) {
        return userMapper.deleteUserById(id);
    }

    public int updateUserStatus(Integer status, Integer id) {
        return userMapper.updateUserStatus(status,id);
    }

    public List<UserDO> userList(String selectUserParam) {
        return userMapper.userList(selectUserParam);
    }

    public int updateUserPassword(String systemPassword, Integer id){
        return userMapper.updateUserPassword(systemPassword, id);
    }

    public int forgetUserPassword(String systemPassword, String userPhone){
        return userMapper.forgetUserPassword(systemPassword, userPhone);
    }

    public int updateUserBanReason(String banReason, Integer id){
        return userMapper.updateUserBanReason(banReason, id);
    }

    public UserDO selectUserByIdCard(String idCard,String userName){
        return userMapper.selectUserByIdCard(idCard, userName);
    }

    public int updateAllUserInfo(UserDO userDO){
        return userMapper.updateAllUserInfo(userDO);
    }

    public List<UserDO> getAllUser(){
        return userMapper.getAllUser();
    }
}
